#lang racket

(require "stream-basics.rkt")

(define (add-streams s1 s2)
  (stream-map + s1 s2))

(define (mul-streams s1 s2)
  (stream-map * s1 s2))

(define 1-to-10 (stream-enumerate-interval 1 10))

(define 1-to-100 (mul-streams 1-to-10 1-to-10))

(display-stream 1-to-100)

(define ones (cons-stream 1 ones))

(define integers (cons-stream 1 (add-streams ones integers)))

(define factorials (cons-stream 1 (mul-streams (stream-cdr integers) factorials)))

(display-stream (stream-take 10 factorials))